<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>CUB: cub::DoubleBuffer&lt; T &gt; Struct Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-38890655-1']);
  _gaq.push(['_trackPageview']);
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">CUB
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacecub.html">cub</a></li><li class="navelem"><a class="el" href="structcub_1_1_double_buffer.html">DoubleBuffer</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Methods</a> &#124;
<a href="#pub-attribs">Public Members</a> &#124;
<a href="structcub_1_1_double_buffer-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">cub::DoubleBuffer&lt; T &gt; Struct Template Reference<div class="ingroups"><a class="el" href="group___util_module.html">Generic CUB utilities</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed description</h2>
<div class="textblock"><h3>template&lt;
    typename T&gt;<br/>
struct cub::DoubleBuffer&lt; T &gt;</h3>

<p>Double-buffer storage wrapper for multi-pass stream transformations that require more than one storage array for streaming intermediate results back and forth. </p>
<p>Many multi-pass computations require a pair of "ping-pong" storage buffers (e.g., one for reading from and the other for writing to, and then vice-versa for the subsequent pass). This structure wraps a set of device buffers and a "selector" member to track which is "current". </p>

<p>Definition at line <a class="el" href="util__type_8cuh_source.html#l00258">258</a> of file <a class="el" href="util__type_8cuh_source.html">util_type.cuh</a>.</p>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Methods</h2></td></tr>
<tr class="memitem:a8d51dcd30484a1f186e056eb7ab09979"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8d51dcd30484a1f186e056eb7ab09979"></a>
__host__ __device__ __forceinline__&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcub_1_1_double_buffer.html#a8d51dcd30484a1f186e056eb7ab09979">DoubleBuffer</a> ()</td></tr>
<tr class="memdesc:a8d51dcd30484a1f186e056eb7ab09979"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <br/></td></tr>
<tr class="separator:a8d51dcd30484a1f186e056eb7ab09979"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a100c51f0e1aefdff4cdfe6480c89f59e"><td class="memItemLeft" align="right" valign="top">__host__ __device__ __forceinline__&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcub_1_1_double_buffer.html#a100c51f0e1aefdff4cdfe6480c89f59e">DoubleBuffer</a> (T *d_current, T *d_alternate)</td></tr>
<tr class="memdesc:a100c51f0e1aefdff4cdfe6480c89f59e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="#a100c51f0e1aefdff4cdfe6480c89f59e">More...</a><br/></td></tr>
<tr class="separator:a100c51f0e1aefdff4cdfe6480c89f59e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a861d3dff1a70d5e5926057a44d9b8724"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a861d3dff1a70d5e5926057a44d9b8724"></a>
__host__ __device__ <br class="typebreak"/>
__forceinline__ T *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcub_1_1_double_buffer.html#a861d3dff1a70d5e5926057a44d9b8724">Current</a> ()</td></tr>
<tr class="memdesc:a861d3dff1a70d5e5926057a44d9b8724"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return pointer to the currently valid buffer. <br/></td></tr>
<tr class="separator:a861d3dff1a70d5e5926057a44d9b8724"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Members</h2></td></tr>
<tr class="memitem:a38a2d8a9d5a36e9e4b9132166717a0b4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a38a2d8a9d5a36e9e4b9132166717a0b4"></a>
T *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcub_1_1_double_buffer.html#a38a2d8a9d5a36e9e4b9132166717a0b4">d_buffers</a> [2]</td></tr>
<tr class="memdesc:a38a2d8a9d5a36e9e4b9132166717a0b4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pair of device buffer pointers. <br/></td></tr>
<tr class="separator:a38a2d8a9d5a36e9e4b9132166717a0b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9641172c847169904c4054856d7c26f4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9641172c847169904c4054856d7c26f4"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcub_1_1_double_buffer.html#a9641172c847169904c4054856d7c26f4">selector</a></td></tr>
<tr class="memdesc:a9641172c847169904c4054856d7c26f4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Selector into <code>d_buffers</code> (i.e., the active/valid buffer) <br/></td></tr>
<tr class="separator:a9641172c847169904c4054856d7c26f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a100c51f0e1aefdff4cdfe6480c89f59e"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">__host__ __device__ __forceinline__ <a class="el" href="structcub_1_1_double_buffer.html">cub::DoubleBuffer</a>&lt; T &gt;::<a class="el" href="structcub_1_1_double_buffer.html">DoubleBuffer</a> </td>
          <td>(</td>
          <td class="paramtype">T *&#160;</td>
          <td class="paramname"><em>d_current</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">T *&#160;</td>
          <td class="paramname"><em>d_alternate</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">d_current</td><td>The currently valid buffer </td></tr>
    <tr><td class="paramname">d_alternate</td><td>Alternate storage buffer of the same size as <code>d_current</code> </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="util__type_8cuh_source.html#l00275">275</a> of file <a class="el" href="util__type_8cuh_source.html">util_type.cuh</a>.</p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="util__type_8cuh_source.html">util_type.cuh</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Aug 23 2013 17:31:12 for CUB by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.4
<br>
&copy; 2013 NVIDIA Corporation
</small></address>
</body>
</html>
